package com.explorati.design_pattern.behavior.state.example;

public class TV {

	// 电视可以看的频道状态
	public final static Channel CCTV1 = new CCTV1();
	public final static Channel CCTV2 = new CCTV2();
	public final static Channel CCTV3 = new CCTV3();

	// 当前频道
	private Channel channel;

	// 设置频道
	private void setChannel(Channel channel) {
		this.channel = channel;
	}

	// 播放CCTV1频道
	public void disCCTV1() {
		this.setChannel(CCTV1);
		this.channel.diaplay();
	}

	public void disCCTV2() {
		this.setChannel(CCTV2);
		this.channel.diaplay();
	}

	public void disCCTV3() {
		this.setChannel(CCTV3);
		this.channel.diaplay();
	}
}
